package com.school.gift.controller;

import com.school.gift.domain.Feedback;
import com.school.gift.service.FeedbackService;
import com.school.support.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zhibi.common.support.response.Response;

import java.util.Date;

/**
 * Created by 执笔 on 2017/3/23.
 */
@Controller
@RequestMapping("feedback")
public class FeedBackController extends BaseController {
    @Autowired
    private FeedbackService feedbackService;

    @RequestMapping("save")
    @ResponseBody
    public Response<String> save(Feedback feedback){
        feedback.setUserId(sessionUser().getId());
        feedback.setAddtime(new Date());
        feedbackService.insertSelective(feedback);
        return Response.ok("");
    }
}
